Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications


Disconnecting from a session-free application service

The following example shows how a client application can disconnect from a session-free application service:

DEFINE VARIABLE hInventory AS HANDLE  NO-UNDO.
DEFINE VARIABLE ret     AS LOGICAL NO-UNDO.

CREATE SERVER hInventory.
ret = hInventory:CONNECT("-AppService inventory -S 5163 -H 4glServices 
                       -sessionModel Session-free -initialConnections 25").
IF NOT ret THEN
  RETURN ERROR "Failed to connect to Inventory application service".
IF ERROR-STATUS:ERROR THEN DO:
  ret = hInventory:DISCONNECT().
  RETURN ERROR RETURN-VALUE.
END.
.
.
.

ret = hInventory:DISCONNECT().
DELETE OBJECT hInventory. 

When the DISCONNECT( ) method executes, the client application disconnects all physical connections to AppServer brokers in the connection pool for the application service referenced by the hInventory handle. When the disconnection request completes, you can send no more remote requests using the disconnected server handle.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095